package com.jiang.www;

import javax.servlet.*;
import java.io.IOException;

public class MyServlet_01 implements Servlet{
    /*
     * servletRequest : 请求
     * servletResponse : 响应
     * */
    @Override
    public void service(ServletRequest servletRequest,
                        ServletResponse servletResponse) throws ServletException, IOException {

        System.out.println("接收到请求"); //控制台打印
        //网页上显示出来,不要写中文,会乱码
        servletResponse.getWriter().print("hello servlet");//响应给浏览器
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {

    }
}
